| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664 |
- <template>
- <!-- 页面头部 -->
- <HomePageHead></HomePageHead>
- <!-- 导航栏 -->
- <HomePageNavigation></HomePageNavigation>
- <!-- 列表页广告一 -->
- <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
- <!-- 资讯列表 -->
- <main class="index_main">
- <!-- 面包屑导航 -->
- <div class="breadcrumb phone_none">
- <div class="inner">
- <span class="location">当前位置:</span>
- <el-breadcrumb :separator-icon="ArrowRight">
- <el-breadcrumb-item>
- <NuxtLink to="/">首页</NuxtLink>
- </el-breadcrumb-item>
- <el-breadcrumb-item v-if="parent_name != ''">
- <NuxtLink :to="`/${targetSegment}/index.html`"> {{ parent_name }}</NuxtLink>
- </el-breadcrumb-item>
- <el-breadcrumb-item>
- <NuxtLink :to="`list-1.html`"> {{ routLevelTitle }}</NuxtLink>
- </el-breadcrumb-item>
- <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- </div>
- <div class="breadcrumb_box pc_none">
-
- <span class=" ">当前位置:</span>
- <NuxtLink to="/">首页</NuxtLink>
- <span class=" " v-if="parent_name !=''">></span>
- <NuxtLink :to="`/${targetSegment}/index.html`"> {{ parent_name }}</NuxtLink>
- <span class=" " >></span>
- <NuxtLink :to="`list-1.html`"> {{ routLevelTitle }}</NuxtLink>
- <span class="" >></span>
- <span class="" >{{ routeNewsTtitle }}</span>
-
- </div>
- <section class="index_2 clearfix">
- <img class="index_2_img" :src="img_one" :title="newsDetail.title" :alt="newsDetail.title">
- <div class="index_2_right">
- <h4 class="index_2_h4">{{ newsDetail.title }}</h4>
- <div class="index_2_ul clearfix phone_none">
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">企业名称</label>
- <span class="index_2_li_text">{{ newsDetail.business_name }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">联 系 人</label>
- <span class="index_2_li_text">{{ newsDetail.content_person }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">电 话</label>
- <span class="index_2_li_text">{{ newsDetail.telephone }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">手 机</label>
- <span class="index_2_li_text">{{ newsDetail.mobile }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">传 真</label>
- <span class="index_2_li_text">{{ newsDetail.fax }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">邮 箱</label>
- <span class="index_2_li_text">{{ newsDetail.email }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">邮 编</label>
- <span class="index_2_li_text">{{ newsDetail.post_code }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">地 址</label>
- <span class="index_2_li_text">{{ newsDetail.address }}</span>
- </div>
- </div>
-
- <div class="index_2_ul clearfix pc_none">
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">企业名称</label>
- <span class="index_2_li_text">{{ newsDetail.business_name }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">电 话</label>
- <span class="index_2_li_text">{{ newsDetail.telephone }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">联 系 人</label>
- <span class="index_2_li_text">{{ newsDetail.content_person }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">传 真</label>
- <span class="index_2_li_text">{{ newsDetail.fax }}</span>
-
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">手 机</label>
- <span class="index_2_li_text">{{ newsDetail.mobile }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">邮 箱</label>
- <span class="index_2_li_text">{{ newsDetail.email }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">邮 编</label>
- <span class="index_2_li_text">{{ newsDetail.post_code }}</span>
- </div>
- <div class="index_2_li clearfix">
- <label class="index_2_li_label">地 址</label>
- <span class="index_2_li_text">{{ newsDetail.address }}</span>
- </div>
- </div>
- </div>
- </section>
- <section class="index_3 clearfix">
- <div class="show_head_box clearfix phone_none">
- <span class="show_head_a show_head_a_only">项目介绍</span>
- </div>
- <div class="phone_box_1 pc_none" >
- <div class="phone_box_1_head">
- <NuxtLink class="" >
- 项目介绍
- </NuxtLink>
- </div>
- </div>
- <article class="show_article" v-html="newsDetail.introduce">
- </article>
- </section>
- <section class="index_4 clearfix">
- <div class="show_head_box_2 clearfix phone_none">
- <span class="show_head_a_2 show_head_a_only_2">加盟详情</span>
- </div>
-
- <div class="phone_box_2 pc_none" >
- <div class="phone_box_1_head">
- <NuxtLink class="" >
- 加盟详情
- </NuxtLink>
- </div>
- </div>
- <article class="show_article_2" v-html="newsDetail.franchise_details">
- </article>
- </section>
- <section class="index_4 clearfix">
- <div class="show_head_box_3 clearfix phone_none">
- <span class="show_head_a_3 show_head_a_only_3">图片展示</span>
- </div>
- <div class="phone_box_3 pc_none" >
- <div class="phone_box_1_head">
- <NuxtLink class="" >
- 图片展示
- </NuxtLink>
- </div>
- </div>
- <div class="img_ul_1 clearfix">
- <div class="img_li_1" title="" v-for="(item, index) in imgList" :key="index">
- <img class="img_li_1_img" :src="item" :title="newsDetail.title" :alt="newsDetail.title">
- </div>
- </div>
- </section>
-
- <section class="index_5 clearfix">
- <div class="index_2_head clearfix phone_none">
- <span class="index_2_head_a index_2_head_a_only" title="">精品项目推荐</span>
- </div>
- <div class="phone_box_4 pc_none" >
- <div class="phone_box_1_head">
- <NuxtLink class="" >
- 精品项目推荐
- </NuxtLink>
- </div>
- </div>
- <div class="categ_ul_img_1 phone_none">
- <div class="categ_li_img_1" v-for="(item, index) in recommend" :key="index">
- <a class="categ_li_img_1_a" :href="getLinkPathDetail(item)" :title="item.title">
- <img class="categ_li_img_1_img" :src="item.imgurl" :title="item.title" :alt="item.title">
- <div class="categ_li_img_1_dot2 dot2">
- {{ item.title }}
- </div>
- </a>
- </div>
- </div>
- <div class="phone_img_ul pc_none">
- <div class="phone_img_li" v-for="(item, index) in recommend.slice(0, 4)" :key="index">
- <a class="phone_img_li_a" :href="getLinkPathDetail(item)" :title="item.title">
- <img class="phone_img_li_img" :src="item.imgurl" :title="item.title" :alt="item.title">
- <div class="phone_img_li_dot2 dot2">
- {{ item.title }}
- </div>
- </a>
- </div>
- </div>
- </section>
- </main>
- <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
- <!-- 页面底部 -->
- <HomeFoot1></HomeFoot1>
- </template>
- <script setup>
- //1.页面依赖 start ---------------------------------------->
- import { onMounted } from 'vue'
- import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
- import { ArrowRight } from '@element-plus/icons-vue'
- //1.页面依赖 end ---------------------------------------->
- //2.页面路径 start ---------------------------------------->
- const route = useRoute();
- const articleId = parseInt(route.params.id);
- const targetSegment = getRoutePath(1);
- const targetSegment1 = getRoutePath(2);
- const parent_name = ref("");
- const parent_id = ref("");
- //通过导航路径反向查询导航id
- const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
- method: 'GET',
- query: {
- 'pinyin': targetSegment,
- },
- });
- if (getRouteId.code == 200) {
- parent_name.value = getRouteId.data.alias;
- parent_id.value = getRouteId.data.category_id;
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:通过url路径查询导航池id")
- console.log("后端错误反馈:", getRouteId.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- //2.页面路径 end ---------------------------------------->
- //3.面包屑 start ---------------------------------------->
- const routLevelTitle = ref("");
- const routLevelId = ref("");
- const getRouteId1 = await requestDataPromise('/web/getWebsiteRoute', {
- method: 'GET',
- query: {
- 'pinyin': targetSegment + '/' + targetSegment1
- },
- });
- if (getRouteId1.code == 200) {
- routLevelTitle.value = getRouteId1.data.alias;
- routLevelId.value = getRouteId1.data.category_id;
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:通过url路径查询导航池id")
- console.log("后端错误反馈:", getRouteId.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- //3.面包屑 end ---------------------------------------->
- //4.新闻详情 start ---------------------------------------->
- //4.1 资讯详情
- const newsDetail = ref({})
- const routeNewsTtitle = ref("");
- //4.2 发布日期
- const time = ref("");
- // 图片列表
- const imgList = ref([]);
- const img_one = ref("");
- //4.3 获取详情
- let seoTitle;
- let seoDescription;
- let seoKeywords;
- async function getPageData() {
- const mkdata = await requestDataPromise('/web/getWebsiteProjectInfo', {
- method: 'GET',
- query: {
- 'id': articleId
- },
- });
- if (mkdata.code == 200) {
- //获取内容
- newsDetail.value = mkdata.data;
- //获取发布时间
- time.value = newsDetail.value.updated_at.split(' ')[0];
- //修正标题长度
- if (newsDetail.value.title.length >= 20) {
- routeNewsTtitle.value = newsDetail.value.title.substr(0, 20) + "...";
- } else {
- routeNewsTtitle.value = newsDetail.value.title
- }
- // 图片列表
- imgList.value = JSON.parse(mkdata.data.imgurl);
- img_one.value = imgList.value[0];
- seoTitle = newsDetail.value.title;
- seoDescription = newsDetail.value.description;
- seoKeywords = newsDetail.value.keyword;
- } else {
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- console.log("错误位置:获取详情内容")
- console.log("后端错误反馈:", mkdata.message)
- console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
- }
- }
- getPageData();
- //4.新闻详情 end ---------------------------------------->
- // 推荐
- let getJson1 = [
- { "level": "1,12,0" },
- ]
- let jsonString1 = JSON.stringify(getJson1);
- getPageHotData(jsonString1);
- // 获取推荐数据
- let recommend = ref([]);
- async function getPageHotData(jsonString1) {
- const mkdata = await requestDataPromise('/web/getWebsiteProject', {
- method: 'GET',
- query: {
- 'id': jsonString1
- },
- });
- console.log('mkdata_HotData', mkdata.data)
- if (mkdata.code == 200) {
- if (mkdata.data.length > 0) {
- recommend.value = mkdata.data[0].img_num;
- }
- } else {
- ElMessage.error(mkdata.message)
- }
- }
- //5.设置seo信息 start---------------------------------------->
- const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
- method: 'GET',
- query: {
- 'catid': parent_id.value
- },
- });
- if (setData.code == 200) {
- let seoSuffix = setData.data.suffix;
- let seoName = setData.data.website_name;
- useSeoMeta({
- title: seoTitle + "_" + seoName + "_" + seoSuffix,
- meta: [
- { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
- { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
- { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no',tagPriority: 10 }
- ]
- });
- } else {
- console.log("设置频道页SEO出错!", setData.message)
- }
- //5.设置seo信息 end---------------------------------------->
- //6.广告 start ---------------------------------------->
- let adImg1 = ref([]);
- let adImg2 = ref([]);
- onMounted(async () => {
- const { $webUrl, $CwebUrl } = useNuxtApp();
- //广告1
- let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_detail_0001`
- const responseAd1 = await fetch(url, {
- headers: {
- 'Content-Type': 'application/json',
- 'Userurl': $CwebUrl,
- 'Origin': $CwebUrl
- }
- });
- const resultAd1 = await responseAd1.json();
- adImg1.value = resultAd1.data[0];
- //广告2
- let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_detail_0002`
- const responseAd2 = await fetch(url2, {
- headers: {
- 'Content-Type': 'application/json',
- 'Userurl': $CwebUrl,
- 'Origin': $CwebUrl
- }
- });
- const resultAd2 = await responseAd2.json();
- adImg2.value = resultAd2.data[0];
- })
- //6.广告 end ---------------------------------------->
- //8.页面图片放大 start---------------------------------------->
- const previewVisible = ref(false)
- const selectedImage = ref(' ')
- const openPreview = (event) => {
- if (event.target.tagName === 'IMG') {
- selectedImage.value = event.target.src;
- previewVisible.value = true;
- }
- }
- const closePreview = () => {
- previewVisible.value = false;
- }
- //8.页面图片放大 end---------------------------------------->
- </script>
- <style lang="less" scoped>
- @import url('@/assets/css/project/detail.less');
- </style>
- <style lang="less" scoped>
-
- @media screen and (min-width:801px){/*pc*/
-
- .pc_none{display:none;}
- }
- @media screen and (max-width:800px){/*ipad_phone*/
-
- .index_main{width:100%;margin:0px auto 30px;}
- .breadcrumb_box {
- height: 22px;
- width: 92%;
- margin: 10px auto;
- word-break: keep-all;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- font-size: 14px;
- color: #666;
- * {
- font-size: 14px;
- display: inline;
- color: #666;
- line-height: 22px;
- height: 22px;
- margin-right: 5px;
- }
- }
- .index_2{width:92%;margin:0px auto 0px;display:block;}
- .index_2_img{width:auto;max-width:100%;height:302px;margin:0px auto 0px;float:none;display:block;border-radius:8px;}
-
- .index_2_right{width:100%;margin:0px auto 0px;float:none;
-
- .index_2_li{margin-bottom:20px;width:49%; }
- .index_2_li:nth-of-type(odd){float:left;}
- .index_2_li:nth-of-type(even){float:right;}
-
- .index_2_li:nth-of-type(1){width:100%;}
- .index_2_li:nth-last-of-type(1){width:100%;}
- .index_2_li:nth-last-of-type(2){width:33%; }
- .index_2_li:nth-last-of-type(3){width:65%; }
- .index_2_li:nth-of-type(n+6){ width:100%;}
-
-
- .index_2_li .index_2_li_label{line-height:18px;height:18px;font-size:14px;
- min-width:auto;margin-right:8px;}
- .index_2_li .index_2_li_text{line-height:18px; font-size:14px;flex:1;
- box-sizing:border-box;
- word-wrap: break-word;
- overflow-wrap: break-word;
- white-space: pre-wrap;
- word-break: break-all;
-
- }
- .index_2_li:nth-of-type(5) .index_2_li_text{ height:auto;
-
- word-wrap: break-word;
- overflow-wrap: break-word;
- white-space: pre-wrap;
- word-break: break-all;
- }
- }
-
- .index_2_h4{font-size:16px;line-height:26px;margin-top:11px;border:0px;padding-bottom:0px;}
-
- .phone_box_1{
-
- width:92%;margin:0px auto 0px;
- .phone_box_1_head{
- height:50px;line-height:50px;
- background:#fff;border-bottom:1px solid #E6E6E6;
- width:100%;
-
- a{
- float:left;height:50px;line-height:50px;margin:0;position:relative;
- color:#489d97;font-size:18px; font-weight:bold;box-sizing:border-box;
- position:relative;padding-left:8px;
- }
- a::before{
- content: '';display: block;
- position:absolute;left:0px;top:18px;
- background: linear-gradient(to top, #0998A9, #6ADDD6);
- width:3px;height:15px;
- }
- }
- }
- .phone_box_2{
-
- width:92%;margin:0px auto 0px;
- .phone_box_1_head{
- height:50px;line-height:50px;
- background:#fff;border-bottom:1px solid #E6E6E6;
- width:100%;
-
- a{
- float:left;height:50px;line-height:50px;margin:0;position:relative;
- color:#489d97;font-size:18px; font-weight:bold;box-sizing:border-box;
- position:relative;padding-left:8px;
- }
- a::before{
- content: '';display: block;
- position:absolute;left:0px;top:18px;
- background: linear-gradient(to top, #0998A9, #6ADDD6);
- width:3px;height:15px;
- }
- }
- }
- .show_article{
- width:92%!important;margin:15px auto 0px!important;
- line-height:26px!important;
- min-height:100px;
- }
- .show_article, .show_article:deep(*){
- font-size:16px!important;line-height:26px!important;
- }
- .show_article_2{
- width:92%!important;margin:15px auto 0px!important;
- line-height:26px!important;
- min-height:100px;
- }
- .show_article_2, .show_article_2:deep(*){
- font-size:16px!important;line-height:26px!important;
- }
- .phone_box_3{
-
- width:92%;margin:0px auto 0px;
- .phone_box_1_head{
- height:50px;line-height:50px;
- background:#fff;border-bottom:1px solid #E6E6E6;
- width:100%;
-
- a{
- float:left;height:50px;line-height:50px;margin:0;position:relative;
- color:#489d97;font-size:18px; font-weight:bold;box-sizing:border-box;
- position:relative;padding-left:8px;
- }
- a::before{
- content: '';display: block;
- position:absolute;left:0px;top:18px;
- background: linear-gradient(to top, #0998A9, #6ADDD6);
- width:3px;height:15px;
- }
- }
- }
- .img_ul_1{
- width:92%;
- margin:0px auto 0px;
- .img_li_1{
- width:100%;margin:15px 0px 0px;
- min-height:100px;float:none;height:auto;
- }
- }
- .phone_box_4{
-
- width:92%;margin:0px auto 0px;
- .phone_box_1_head{
- height:50px;line-height:50px;
- background:#fff;border-bottom:1px solid #E6E6E6;
- width:100%;
-
- a{
- float:left;height:50px;line-height:50px;margin:0;position:relative;
- color:#489d97;font-size:18px; font-weight:bold;box-sizing:border-box;
- position:relative;padding-left:8px;
- }
- a::before{
- content: '';display: block;
- position:absolute;left:0px;top:18px;
- background: linear-gradient(to top, #0998A9, #6ADDD6);
- width:3px;height:15px;
- }
- }
- }
- .phone_img_ul{
- width:92%;overflow:hidden;min-height:447px;
- margin:0 auto 0;
- .phone_img_li{ width:48%; margin-top:15px;}
- .phone_img_li:nth-of-type(odd){float:left;}
- .phone_img_li:nth-of-type(even){float:right;}
- .phone_img_li_a{width:100%;display:block;}
- .phone_img_li_img{display:block;width:100%;height:44vw;}
- .phone_img_li_dot2{
- color: #333;
- font-size: 4vw;
- height: 10vw;
- line-height: 5vw;
- margin-top: 6px;
-
- width: 100%;}
- }
- .index_3{margin-top:0px;}
- .index_4{margin-top:0px;}
- .phone_none{display:none;}
- }
- </style>
|